﻿using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Screens.Renders.Windows
{
    public class EntityReadScreenRenderer : IEntityReadScreenRenderer
    {
        public void RenderParentClass(EntityReadScreen control, CodeWriter writer)
        {
            //writer.Write(string.Format("ReadEntityViewModel<{0}Model, {0}Entity>", control.EntityName));
        }


        public void RenderCode(EntityReadScreen control, CodeWriter writer)
        {
            writer.Write(string.Format(@"
        public {0}ReadEntityView()
        {{
            InitializeComponent();
        }}

        public new {0}ReadEntityViewModel ViewModel
        {{
            get {{ return base.ViewModel as {0}ReadEntityViewModel; }}
            set {{ base.ViewModel = value; }}
        }}
", control.EntityName));
        }

        public void RenderControls(EntityReadScreen control, CodeWriter writer)
        {
            control.Controls.RenderUiXml(writer);
        }
    }
}
